﻿/*using System;
using EzDesk.DesktopClient.Event;
using EzDesk.DesktopClient.Model;
using EzDesk.DesktopClient.MVVMEnhance;
using EzDesk.DesktopClient.ViewContract;
using EzDesk.Generic;

namespace EzDesk.DesktopClient.ViewModel
{
    public class FeedItemViewModel : ViewModelWithSingleContainer<IFeedItemView>
    {
        private IFeedItemView _view;

        public FeedItemViewModel(IFeedItemView view)
        {
        }

        public FeedItemViewModel(Feed model)
        {
            InitData(model);
            InitLocalEvent();
        }

        public Feed FeedModel { get; set; }

        public string DisplayContent
        {
            get { return FeedModel.TransformedData; }
            set { FeedModel.TransformedData = value; }
        }

        public DateTime LastUpdate
        {
            get { return FeedModel.LastChangeOn.Value; }
            set { FeedModel.LastChangeOn = value; }
        }

        public override IFeedItemView View
        {
            get
            {
                if(null == _view)
                {
                    switch(FeedModel.Type)
                    {
                        case FeedTypes.Notification:
                            _view = Container.Resolve<INotificationItemView>();
                            break;
                        case FeedTypes.Update:
                            _view = Container.Resolve<IUpdateItemView>();
                            break;
                        default:
                            throw new NotImplementedException("Other feed types not supported now.");
                    }
                }
                _view.ViewModel = this;
                return _view;
            }
            set { _view = value; }
        }

        public bool IsRead
        {
            get { return FeedModel.IsRead.Value; }
            set
            {
                FeedModel.IsRead = value;
                RaisePropertyChanged("IsRead");
            }
        }

        public bool IsAvailable
        {
            get { return FeedModel.IsAvailable.Value; }
            set
            {
                FeedModel.IsAvailable = value;
                RaisePropertyChanged("IsAvailable");
            }
        }

        public bool IsMark
        {
            get { return FeedModel.IsMark.Value; }
            set
            {
                FeedModel.IsMark = value;
                RaisePropertyChanged("IsMark");
            }
        }

        private void InitData(Feed model)
        {
            FeedModel = model;
        }

        private void InitLocalEvent()
        {
            View.OnNavigate += OnNavigate;
            View.SetAsRead += View_SetAsRead;
        }

        private void OnNavigate(object sender, GenericEventArg<string> e)
        {
            FunctionNavigateEvent.Instance.Publish(new FunctionNavigateArgs { Url = e.Value });
        }

        private void View_SetAsRead(object sender, EventArgs e)
        {
            FeedModel.IsRead = true;
            FeedStatusChangeEvent.Instance.Publish(FeedModel);
        }
    }
}*/